package com.wl.jetpackdemo

import android.app.Application
import com.wl.jetpackdemo.base.Constant
import com.wl.jetpackdemo.base.db.DBManager
import com.wl.wllite.net.RetrofitManager

/**
 *
 * Created by wangliang on 2021/1/28.
 */
class App : Application() {
    override fun onCreate() {
        super.onCreate()

        initBaseUrl()

        DBManager.init(this.applicationContext)
    }

    private fun initBaseUrl() {
        if(BuildConfig.DEBUG) {
            RetrofitManager.setBaseUrl(Constant.BASE_URL_DEVELOP)
        } else {
            RetrofitManager.setBaseUrl(Constant.BASE_URL_PRODUCTION)
        }
    }
}